#!/Python33/python.exe
import serial, time
import cgi

print ("STATUS: 200 OK\n")
req = cgi.FieldStorage();
#result = 0
ser = serial.Serial(req['p'].value, 9600)
ser.write(bytes(req['c'].value,'latin'))
ser.flush()
result = ser.readline().strip()
print (result.decode('utf-8').strip())
ser.close()